package cn.tedu.review;

import java.util.Arrays;
import java.util.Locale;

/**
 * @author: Dsi
 * @date: 2021/11/15 9:12
 * @description:该类用于回顾String类
 */
public class TestString {
    public static void main(String[] args) {
        String s2="abc";
        char[] a={'a','b','c'};
//        char[] a=new char[]{'4'};
//        char[] a=new char[4];
        String s1=new String(a);
        System.out.println(s1.equals(s2));
        System.out.println(s1.hashCode());
        System.out.println(s2.hashCode());
        System.out.println(s1);
        System.out.println(s1.length());
        System.out.println(s1.toLowerCase());//小写
        System.out.println(s1.toUpperCase());//大写
        System.out.println(s1.startsWith("c"));//是否以指定字符开始
        System.out.println(s1.endsWith("c"));//是否以指定字符结束
        System.out.println(s1.charAt(0));//指定下标字符
        System.out.println(s1.indexOf("a"));//指定字符第一次出现的下标
        System.out.println(s1.lastIndexOf(0));//指定字符最后出现的下标
        System.out.println(s1.concat("abc"));
        String s3=s1.concat("123");
        System.out.println(s3);
        System.out.println(s3.split("b"));
        System.out.println(Arrays.toString(s3.split("b")));
        String s5 = "   asd sd    ";
        System.out.println(s5.trim());
        String s6="abcdefg";
        System.out.println(s6.substring(3));
        System.out.println(s6.substring(3,5));
        System.out.println(s6.getBytes());
        System.out.println(Arrays.toString(s6.getBytes()));

        System.out.println(10 + 10);//20
        System.out.println("10"+10);//1010
        System.out.println(String.valueOf(10) + 10);//1010
        System.out.println(10+""+10);







    }
}
